Optimal. Leaf size=59 \[ \frac {\log (\tan (x))}{a^3}-\frac {\log (a+b \tan (x))}{a^3}+\frac {\frac {1}{a}+\frac {a}{b^2}}{2 (a+b \tan (x))^2}+\frac {\frac {1}{a^2}-\frac {1}{b^2}}{a+b \tan (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3166, 908}
\begin {gather*} -\frac {\log (a+b \tan (x))}{a^3}+\frac {\log (\tan (x))}{a^3}+\frac {\frac {1}{a^2}-\frac {1}{b^2}}{a+b \tan (x)}+\frac {\frac {a}{b^2}+\frac {1}{a}}{2 (a+b \tan (x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 908
Rule 3166
Rubi steps
\begin {align*} \int \frac {\csc (x)}{(a \cos (x)+b \sin (x))^3} \, dx &=\text {Subst}\left (\int \frac {1+x^2}{x (a+b x)^3} \, dx,x,\tan (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {1}{a^3 x}+\frac {-a^2-b^2}{a b (a+b x)^3}+\frac {a^2-b^2}{a^2 b (a+b x)^2}-\frac {b}{a^3 (a+b x)}\right ) \, dx,x,\tan (x)\right )\\ &=\frac {\log (\tan (x))}{a^3}-\frac {\log (a+b \tan (x))}{a^3}+\frac {\frac {1}{a}+\frac {a}{b^2}}{2 (a+b \tan (x))^2}+\frac {\frac {1}{a^2}-\frac {1}{b^2}}{a+b \tan (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.25, size = 96, normalized size = 1.63 \begin {gather*} \frac {a^2 \csc ^2(x)+2 a b \cot (x) (-1+2 \log (\sin (x))-2 \log (a \cos (x)+b \sin (x)))+2 b^2 (-1+\log (\sin (x))-\log (a \cos (x)+b \sin (x)))+2 a^2 \cot ^2(x) (\log (\sin (x))-\log (a \cos (x)+b \sin (x)))}{2 a^3 (b+a \cot (x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.32, size = 73, normalized size = 1.24
method | result | size |
default | \(\frac {\ln \left (\tan \left (x \right )\right )}{a^{3}}-\frac {-a^{2}-b^{2}}{2 a \,b^{2} \left (a +b \tan \left (x \right )\right )^{2}}-\frac {a^{2}-b^{2}}{a^{2} b^{2} \left (a +b \tan \left (x \right )\right )}-\frac {\ln \left (a +b \tan \left (x \right )\right )}{a^{3}}\) | \(73\) |
norman | \(\frac {-\frac {2 \left (-a^{2}+3 b^{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{a^{3}}-\frac {4 b \tan \left (\frac {x}{2}\right )}{a^{2}}+\frac {4 b \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a^{2}}}{\left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 b \tan \left (\frac {x}{2}\right )-a \right )^{2}}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{a^{3}}-\frac {\ln \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 b \tan \left (\frac {x}{2}\right )-a \right )}{a^{3}}\) | \(103\) |
risch | \(\frac {2 a^{2} {\mathrm e}^{2 i x}-2 b^{2} {\mathrm e}^{2 i x}-4 i a b \,{\mathrm e}^{2 i x}+2 b^{2}-2 i a b}{\left (-i b \,{\mathrm e}^{2 i x}+a \,{\mathrm e}^{2 i x}+i b +a \right )^{2} a^{2} \left (-i b +a \right )}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right )}{a^{3}}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {i b +a}{i b -a}\right )}{a^{3}}\) | \(119\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 172 vs.
\(2 (57) = 114\).
time = 0.29, size = 172, normalized size = 2.92 \begin {gather*} -\frac {2 \, {\left (\frac {2 \, a b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {2 \, a b \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - \frac {{\left (a^{2} - 3 \, b^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}}{a^{5} + \frac {4 \, a^{4} b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {4 \, a^{4} b \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {a^{5} \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} - \frac {2 \, {\left (a^{5} - 2 \, a^{3} b^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}} - \frac {\log \left (-a - \frac {2 \, b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{a^{3}} + \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 220 vs.
\(2 (57) = 114\).
time = 2.55, size = 220, normalized size = 3.73 \begin {gather*} \frac {4 \, a^{2} b^{2} \cos \left (x\right )^{2} + a^{4} - a^{2} b^{2} - 2 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} b^{2} + b^{4} + {\left (a^{4} - b^{4}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cos \left (x\right ) \sin \left (x\right )\right )} \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}\right ) + {\left (a^{2} b^{2} + b^{4} + {\left (a^{4} - b^{4}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cos \left (x\right ) \sin \left (x\right )\right )} \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right )}{2 \, {\left (a^{5} b^{2} + a^{3} b^{4} + {\left (a^{7} - a^{3} b^{4}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{6} b + a^{4} b^{3}\right )} \cos \left (x\right ) \sin \left (x\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc {\left (x \right )}}{\left (a \cos {\left (x \right )} + b \sin {\left (x \right )}\right )^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 77, normalized size = 1.31 \begin {gather*} -\frac {\log \left ({\left | b \tan \left (x\right ) + a \right |}\right )}{a^{3}} + \frac {\log \left ({\left | \tan \left (x\right ) \right |}\right )}{a^{3}} + \frac {3 \, b^{4} \tan \left (x\right )^{2} - 2 \, a^{3} b \tan \left (x\right ) + 8 \, a b^{3} \tan \left (x\right ) - a^{4} + 6 \, a^{2} b^{2}}{2 \, {\left (b \tan \left (x\right ) + a\right )}^{2} a^{3} b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.71, size = 131, normalized size = 2.22 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a^3}-\frac {\ln \left (-a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )+a\right )}{a^3}+\frac {\frac {2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\left (a^2-3\,b^2\right )}{a^3}+\frac {4\,b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{a^2}-\frac {4\,b\,\mathrm {tan}\left (\frac {x}{2}\right )}{a^2}}{a^2-{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\left (2\,a^2-4\,b^2\right )+a^2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4+4\,a\,b\,\mathrm {tan}\left (\frac {x}{2}\right )-4\,a\,b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________